#pragma once



#include <mfapi.h>

#include "qvideoplayer.h"
using namespace micro::media;



namespace micro
{
namespace media
{


class QMediaInitializer
{
public:
    QMediaInitializer( void )
    {
        MediaStartup( MF_VERSION,  MFSTARTUP_LITE );
    }
    ~QMediaInitializer( void )
    {

        // Media Foundation platform
        MFShutdown();

    }
    bool MediaStartup( ULONG Version = MF_VERSION, DWORD dwFlags = MFSTARTUP_LITE ) //MFSTARTUP_FULL
    {
        // Start up Media Foundation platform.
        HRESULT hr = MFStartup( Version, dwFlags );

        if ( FAILED( hr ) )
            throw QError();

        return true;
    }
};


}
}//